<!--
 * @Author: your name
 * @Date: 2021-10-19 15:47:34
 * @LastEditTime: 2021-10-19 18:20:56
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \Vuec:\Users\86131\Desktop\project\payforknowledge\src\views\classvideo.vue
-->
<!-- 课程音频播放详情页 -->
<template>
  <div class="content">
    <!-- 导航栏 -->
    <van-nav-bar title="" left-arrow :border="false" @click-left="onClickLeft">
      <template #right>
        <van-icon name="shrink" size="18" />
      </template>
    </van-nav-bar>
    <!-- 图片 -->
    <div class="pic">
      <img :src="detailList[0]?.imgUrl" alt="" />
    </div>
    <!-- 订阅 -->
    <div class="read">
      <div class="read-top">
        <p>{{ detailList[0]?.title }}</p>
        <img src="../../src/assets/img/shoucang.png" alt="" />
      </div>
      <div class="read-bot">
        <p>{{ detailList[0]?.name }}</p>
        <span>{{ detailList[0]?.num }}人订阅</span>
      </div>
      <!-- 进度条 -->
      <van-progress
        :percentage="5"
        stroke-width="10"
        :show-pivot="false"
        :inactive="true"
      />
    </div>
    <!-- 图标 -->
    <div class="icon">
      <div class="icon1">
        <img src="../../src/assets/img/liebiao.png" alt="" />
      </div>
      <div class="icon2">
        <img src="../../src/assets/img/houtui.png" alt="" />
      </div>
      <div class="icon3">
        <img src="../../src/assets/img/bofang.png" alt="" />
      </div>
      <div class="icon4">
        <img src="../../src/assets/img/kuaijin.png" alt="" />
      </div>
      <div class="icon5">
        <img src="../../src/assets/img/biji.png" alt="" />
      </div>
    </div>
    <!-- 文字 -->
    <div class="text">
      <p>
        系统而真切地了解心理学体系知识，迈入心理学学科大门。课程内容凝练了武志红多年心理咨询经验，以及撰写三百多万字心理书籍后积累的思考笔记，这些模块的知识体系，会全部交付给你。<br />
        系统而真切地了解心理学体系知识，迈入心理学学科大门。课程内容凝练了武志红多年心理咨询经验，以及撰写三百多万字心理书籍后积累的思考笔记，这些模块的知识体系，会全部交付给你。<br />
        系统而真切地了解心理学体系知识，迈入心理学学科大门。课程内容凝练了武志红多年心理咨询经验，以及撰写三百多万字心理书籍后积累的思考笔记，这些模块的知识体系，会全部交付给你。
      </p>
    </div>
    <!-- 评论框 -->
    <div class="plk">
      <div>
        <input type="text" placeholder="请输入评论内容" />
      </div>
      <div class="plk-icon">
        <div class="icon-left">
          <img src="../../src/assets/img/chakan.png" alt="" />
        </div>
        <div class="icon-right">
          <img src="../../src/assets/img/dianzan.png" alt="" />
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import { NavBar, Icon, Progress } from "vant";
import { useRoute, useRouter } from "vue-router";
import { ref } from "vue";
export default {
  components: {
    VanNavBar: NavBar,
    VanIcon: Icon,
    VanProgress: Progress,
  },
  setup() {
    const route = useRoute();
    const router = useRouter();
    let detailList = ref([]);
    const getdetail = () => {
      let id = route.query.id;
      fetch("http://1.116.189.101:3000/api/getdetail", {
        method: "post",
        headers: {
          "Content-Type": "application/x-www-form-urlencoded",
        },
        body: `id=${id}`,
      })
        .then((response) => response.json())
        .then((res) => {
          if (res.status === 0) {
            detailList.value = res.result;
            console.log(detailList.value);
          }
        });
    };
    getdetail();
    const onClickLeft = () => {
      router.go(-1);
    };
    return {
      detailList,
      onClickLeft,
    };
  },
};
</script>

<style lang="less" scoped>
/deep/ .van-nav-bar .van-icon {
  font-size: 24px;
  color: #424242;
}
/deep/ .van-icon-shrink:before {
  font-size: 24px;
  color: #424242;
}
.content {
  // 图片
  .pic {
    background: #fff;
    padding-top: 35px;
    text-align: center;
    img {
      width: 202px;
      height: 289px;
    }
  }
  // 订阅
  .read {
    background: #fff;
    padding: 10px;
    border-bottom: 1px solid #f0f0f0;
    .read-top {
      display: flex;
      align-items: center;
      justify-content: space-between;
      p {
        font-weight: bolder;
        color: #323232;
        font-size: 29px;
      }
      img {
        width: 18px;
        height: 18px;
      }
    }
    .read-bot {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 6px 0;
      p {
        font-size: 17px;
        color: #8f8f8f;
      }
      span {
        font-size: 12px;
        color: #a5a5a5;
      }
    }
    // 进度条
    .van-progress {
      // overflow: hidden;
      border-radius: 0;
      margin-bottom: 8px;
      // border-radius: 20px;
      /deep/ .van-progress__portion {
        // border-radius: 20px !important;
        background: #909090 !important;
      }
    }
  }
}
// 图标
.icon {
  background: #fff;
  padding-top: 40px;
  display: flex;
  align-items: center;
  justify-content: space-evenly;
  .icon1 {
    img {
      width: 25px;
      height: 23px;
    }
  }
  .icon2 {
    img {
      width: 25px;
      height: 23px;
    }
  }
  .icon3 {
    img {
      width: 55px;
      height: 54px;
    }
  }
  .icon4 {
    img {
      width: 25px;
      height: 23px;
    }
  }
  .icon5 {
    img {
      width: 25px;
      height: 23px;
    }
  }
}
// 文字
.text {
  background: #fff;
  padding: 15px 10px 0 10px;
  height: 159px;
  overflow: auto;
  p {
    font-size: 12px;
    color: #7a7a7a;
    letter-spacing: 1px;
    line-height: 16px;
  }
}
// 评论框
.plk {
  background: #fff;
  padding-left: 10px;
  display: flex;
  justify-content: space-between;
  padding-bottom: 26px;
  input {
    width: 250px;
    height: 32px;
    border-radius: 20px;
    // border: 1px solid red;
    border: 0;
    background: #ededed;
    font-size: 16px;
    padding-left: 15px;
    &::placeholder {
      font-size: 14px;
      color: #9e9e9e;
      font-weight: bold;
      position: relative;
      top: 0px;
      left: 10px;
    }
  }
  .plk-icon {
    display: flex;
    justify-content: space-between;
    flex: 1;
    padding: 0 12px 0 30px;
    .icon-left {
      img {
        width: 20px;
        height: 20px;
      }
    }
    .icon-right {
      img {
        width: 20px;
        height: 20px;
      }
    }
  }
}
</style>
